package com.rx.mine.service;


import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class CacheService {
    @Cacheable(cacheNames = "user", key = "#token")
    public Object getData(String token){
        // 获取缓存中的token
        log.info("getData");
        return null;
    }

    @CachePut(cacheNames = "user", key = "#token")
    public Object putData(String token,Object val){
        // 获取缓存中的token
        log.info("putData");
        log.info(val.toString());
        return val;
    }
}
